feat: enhance string utilities and fix forEach callback#4
Open
mysbryce wants to merge 3 commits intoerrorism-scripts:masterfrom
Open
feat: enhance string utilities and fix forEach callback#4mysbryce wants to merge 3 commits intoerrorism-scripts:masterfrom
mysbryce wants to merge 3 commits intoerrorism-scripts:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhance String Utilities and Fix Collection Helpers
This PR introduces several new string manipulation utilities and fixes a parameter-passing issue in the
forEachcollection helper. These additions aim to make string handling more robust and provide common utility patterns used across the project.Changes
Features
String Interpolation: Enhanced the helper to support dynamic variable injection using ${key} syntax.
New String Utilities: Added the following helper functions:
trim: Removes leading/trailing whitespace.capitalize: Capitalizes the first letter and lowers the rest (includes a regex fix for consistent behavior).startsWith/endsWith: Efficient prefix and suffix checking.truncate: Shortens strings to a specific length with a customizable suffix (defaulting to ...).Bug Fixes
forEachMethod: Updated the callback signature to ensure the index is correctly passed as the second argument, allowing for indexed iteration.